<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Development Manual</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link rel="stylesheet" href="./css/bootstrap.min.css">
<script type="text/javascript" src="js/jquery.min.js"></script>

<link href="css/layout2.css" media="all" rel="stylesheet" />
<link href="css/slide.css" media="all" rel="stylesheet" />
<link href="css/font.css" media="all" rel="stylesheet" />
<script type="text/javascript">

$(function(){
    $('#LinkDiv').hide();
    $('#addBtn').click(function (){
        console.log("show LinkDiv");
        $('#LinkDiv').show();
    });
    $('#saveBtn2').click(function (){
        console.log("hide LinkDiv");
        $('#LinkDiv').hide();
    });
    
    $('.glyphicon-edit').click(function (){
        console.log("show LinkDiv");
        $('#LinkDiv').show();
    });
    
    $('.glyphicon-remove').click(function (){
            var answer = confirm('Are you sure you want to delete this?');
            if (answer)
            {
              console.log('yes');
            }
            else
            {
              console.log('cancel');
            }
        });
});

</script>
<style type="text/css">
#linkTab {
    font-size: 12px;
    font-family: Arial;
    color: #330099;
    line-height: 24px;
    text-align: left
}

ul.mktree  li.liBullet  .bullet {
    cursor: default;
    background: url(images/b1.gif) center left no-repeat;
}
.contentTab {
    width: 100%;
    margin-bottom: 20px
}
.contentTab caption {
    padding: 6px;
    background-color: #ddeeff;
    color: white;
    font-size: 1.2em;
}
.contentTab thead > tr {
    background-color: #CCFFEE;
    border: 2px groove #ddeeff;
}
.contentTab tbody {
    border: 2px groove #ddeeff;
}


.contentTab thead > tr > th {
    font-size: 1.1em;
}


.contentTab tfoot > tr > td {
    text-align: right;    
    font-size: 1.1em;
    font-family: Arial;

}
.pagination {
    margin: 0px
}
.pageTab {
    margin: 0px
}
.pageTab tbody {
    border: 0px groove #ddeeff;
}

.pageTab tbody > tr > td {
    padding: 0px;   
    margin: 0px; 
    font-size: 0.9 em;
    font-family: Arial;
}

.siteTab tbody {
    border: 0px groove #ddeeff;
}

.siteTab tbody > tr > td {
    padding: 2px;
    text-align: right;    
    font-size: 1em;
    font-family: Arial;
}

.didTab tbody {
    border: 0px groove #ddeeff;
}

.didTab tbody > tr > td {
    padding: 2px;
    text-align: right;    
    font-size: 1em;
    font-family: Arial;
}

.fullBtn{ 
    width:5em;
    background-color:#cfe
}

.table-hover tbody > tr:hover > td, 
.table-hover tbody > tr:hover > th {
    background-color: #9999ff
}
.footer { margin-left: auto; margin-right:auto; *zoom: 1;}
</style>

</head>

<body>
<div id="container">
<div id="top">
<h1>Development Aid Tools v1.0</h1>
<div id="header">
  <ul>
    <li id="current"><a href="index.html">Home</a></li>
    <li><a href="bookmark.html">Bookmark</a></li>
    <li><a href="manual.html">Manual</a></li>
    <li><a href="snippetss.html">Snippet</a></li>
    <li><a href="glossary.html">Glossary</a></li>
  </ul>
</div>
<div style="clear:both"></div>
</div>

<div id="leftnav">
    <ul>
        <li>links</li>
        <li>codes</li>
    </ul>

</div>
<div id="content">
<h2>Restful API format</h2>
<ul>
<li>GET（SELECT）：从服务器取出资源（一项或多项）。</li>
<li>POST（CREATE）：在服务器新建一个资源。</li>
<li>PUT（UPDATE）：在服务器更新资源（客户端提供改变后的完整资源）。</li>
<li>PATCH（UPDATE）：在服务器更新资源（客户端提供改变的属性）。</li>
<li>DELETE（DELETE）：从服务器删除资源。</li>
</ul>
<h2>Restful API result</h2>
<ul>
<li>GET /collection：返回资源对象的列表（数组）
<li>GET /collection/resource：返回单个资源对象
<li>POST /collection：返回新生成的资源对象
<li>PUT /collection/resource：返回完整的资源对象
<li>PATCH /collection/resource：返回完整的资源对象
<li>DELETE /collection/resource：返回一个空文档
</ul>

<h2>Parameters</h2>
<pre>
?limit=10：指定返回记录的数量
?offset=10：指定返回记录的开始位置。
?page=2&per_page=100：指定第几页，以及每页的记录数。
?sortby=name&order=asc：指定返回结果按照哪个属性排序，以及排序顺序。
?animal_type_id=1：指定筛选条件
</pre>

<h2>Example:</h2>
<h3>    http://waltersite:1975/api/v1/links </h3>
<pre>
    GET /links：list all link
    POST /links：create a link
    GET /links/ID：retrieve a link
    PUT /links/ID： update a link with all fields
    PATCH /links/ID：update a link with part of fields
    DELETE /links/ID：delete a link
    GET /links/ID/tags：list all tags of a link
    DELETE /links/ID/tags/ID：delete a tag of a link
    GET /links/search/links?tag=lua：search links as tag


</pre>

</div><!-- content div end -->
<div id="footer">
<h2>Copyright &copy; 2009-2010 <a
    href="mailto:walter.fan@gmail.com"> <em>Walter Fan</em></a> all rights
reserved.</h2>
</div>
</div>
</body>
</html>
